import "./index.scss";
import {
  Tabs,
  Form,
  Input,
  DatePicker,
  Select,
  Button,
  Table,
  Space,
  Popconfirm,
  Modal,
  message,
} from "antd";
import TextArea from "antd/es/input/TextArea";
import type { ColumnsType } from "antd/es/table";
import { useState, useEffect } from "react";
import http from "../../../utils/http";
import { useNavigate } from "react-router-dom";
import "dayjs/locale/zh-cn";
import locale from "antd/es/date-picker/locale/zh_CN";
import { CSVLink } from "react-csv";

const TeacherManage = () => {
  //时间转换
  const toDub = (n: any) => (n < 10 ? "0" + n : "" + n);
  //年月日时分秒
  const toTime = (date: any) => {
    const oTime = new Date(date);
    return (
      oTime.getFullYear() +
      "-" +
      toDub(oTime.getMonth() + 1) +
      "-" +
      toDub(oTime.getDate()) +
      " " +
      toDub(oTime.getHours()) +
      ":" +
      toDub(oTime.getMinutes()) +
      ":" +
      toDub(oTime.getSeconds())
    );
  };
  //年月日
  const toDate = (date: any) => {
    const oDate = new Date(date);
    return (
      oDate.getFullYear() +
      "-" +
      toDub(oDate.getMonth() + 1) +
      "-" +
      toDub(oDate.getDate())
    );
  };

  //获取所有机构
  const [ins,useins]=useState([])
  const getIns = () => {
    http({
      url: "/getIns",
    }).then((res) => {
      console.log("-------", res.data);

      let ins = res.data.map((v: { oname: any }) => {
        return v;
      });
      console.log("insinsins", ins);
      useins(ins)
    });
  };
  useEffect(() => {
    getIns();
  }, []);


  //状态的切换
  const onChange = (key: string) => {
    console.log(key);
  };

  //跳转详情页面
  const navigate = useNavigate();
  const toDetail = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail`, { state: record });
  };

  //待审核表格
  const [data1, setData1] = useState([]);
  interface DataType {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    ttime: string;
  }
  const columns: ColumnsType<DataType> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "提交时间",
      dataIndex: "ttime",
      key: "ttime",
      render: (text) => <a className="todate">{toTime(text)}</a>,
    },
    {
      title: "操作",
      key: "action",
      render: (_: any, record: any) => (
        <Space size="middle">
          <a
            onClick={() => {
              showEdit(record);
            }}
            className="tname"
          >
            编辑
          </a>
          <a
            onClick={() => {
              showPass(record);
            }}
            className="tname"
          >
            通过
          </a>
          <a
            onClick={() => {
              showNoPass(record);
            }}
            className="noPass"
          >
            不通过
          </a>
          <Popconfirm
            title="你确定删除这条信息吗?"
            onConfirm={() => {
              confirm(record);
            }}
            onCancel={cancel}
            okText="确定"
            cancelText="取消"
          >
            <a href="#" className="tname">
              删除
            </a>
          </Popconfirm>
        </Space>
      ),
    },
  ];

  // 渲染待审核表格数据
  const getData1 = () => {
    http({
      url: "/getTeacher",
    }).then((res) => {
      console.log("所有数据", res);

      let _data1 = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData1(_data1);
    });
  };
  useEffect(() => {
    getData1();
  }, []);

  //待审核搜索的表单
  const [searchText1] = Form.useForm();
  //待审核搜索
  const onSearch1 = (search: any) => {
    http({
      url: "/searchTeacher",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
        ttime:
          toDate(search.ttime) == "NaN-NaN-NaN"
            ? ""
            : toDate(search.ttime) || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData1(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //待审核清空搜索
  const clear1 = () => {
    searchText1.resetFields();
    getData1();
  };

  // 新增
  const [isAddOpen, setIsAddOpen] = useState(false);
  const showAdd = () => {
    setIsAddOpen(true);
  };
  // 确定新增
  const [addText] = Form.useForm();
  const onAdd = (values: any) => {
    console.log("Add:", values);
    http({
      url: "/addTeacher",
      method: "post",
      data: {
        tname: values.tname,
        tinstitution: values.tinstitution,
        tsex: values.tsex,
        tborn: toDate(values.tborn),
        tidentity: values.tidentity,
        tdegree: values.tdegree,
        tface: values.tface,
        tcourse: values.tcourse,
        tqualtype: values.tqualtype,
        tqualification: values.tqualification,
        origin: values.origin,
        graduate: values.graduate,
        contract: values.contract,
        isgo: values.isgo,
        idphoto: values.idphoto,
        xlphoto: values.xlphoto,
        jsphoto: values.jsphoto,
        zjphoto: values.zjphoto,
      },
    }).then((res: { [key: string]: any }) => {
      console.log(res);
      if (res.error == 0) {
        message.success("添加成功");
        setIsAddOpen(false);
        addText.resetFields();
        getData1();
      } else {
        message.error("添加失败");
      }
    });
  };
  const handleCancelAdd = () => {
    setIsAddOpen(false);
  };

  // 编辑框
  const [editForm] = Form.useForm();
  const [isModalOpen, setIsEditOpen] = useState(false);
  //编辑框赋值
  const showEdit = (record: any) => {
    console.log("editrecord", record);
    editForm.setFieldsValue({ ...record });
    setIsEditOpen(true);
  };
  // 确定编辑
  const handleOk = () => {
    const data = editForm.getFieldsValue(true);
    http({
      url: "/editTeacher",
      method: "post",
      data: data,
    }).then((res: { [key: string]: any }) => {
      console.log(res);
      if (res.error == 0) {
        message.success("修改成功");
        setIsEditOpen(false);
        getData1();
      } else {
        message.error("修改失败");
      }
    });
    setIsEditOpen(false);
  };
  const handleCancel = () => {
    setIsEditOpen(false);
  };

  // 确定删除
  const confirm = (record: { id: number }) => {
    http({
      url: "delTeacher",
      method: "post",
      data: {
        id: record.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("删除成功");
        getData1();
      } else {
        message.error("删除失败");
      }
    });
  };
  const cancel = () => {
    message.error("取消删除");
  };

  // 不通过
  const [isModalOpenNoPass, setIsModalOpenNoPass] = useState(false);
  const [noPassForm] = Form.useForm();
  const showNoPass = (record: any) => {
    noPassForm.setFieldsValue({ ...record });
    setIsModalOpenNoPass(true);
  };
  const handleOkNoPass = () => {
    const data = noPassForm.getFieldsValue(true);
    http({
      url: "/noPassTeacher",
      method: "post",
      data: {
        id: data.id,
        noreason: data.noreason,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("未通过成功");
        setIsModalOpenNoPass(false);
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
      } else {
        message.error("未通过失败");
      }
    });
  };
  const handleCancelNoPass = () => {
    setIsModalOpenNoPass(false);
  };

  // 通过
  const [isModalOpenPass, setIsModalOpenPass] = useState(false);
  const [passForm] = Form.useForm();
  const showPass = (record: any) => {
    passForm.setFieldsValue({ ...record });
    setIsModalOpenPass(true);
  };
  const handleOkPass = () => {
    const data = passForm.getFieldsValue(true);
    http({
      url: "/passTeacher",
      method: "post",
      data: {
        id: data.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("已通过");
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
        setIsModalOpenPass(false);
      } else {
        message.error("通过失败");
      }
    });
  };
  const handleCancelPass = () => {
    setIsModalOpenPass(false);
  };

  //待审批表格
  const [data2, setData2] = useState([]);
  interface DataType2 {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    ttime: string;
  }
  const columns2: ColumnsType<DataType2> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail1(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "操作",
      key: "action",
      render: (_: any, record: any) => (
        <Space size="middle">
          <a
            onClick={() => {
              showPass1(record);
            }}
            className="tname"
          >
            通过
          </a>
          <a
            onClick={() => {
              showNoPass1(record);
            }}
            className="noPass"
          >
            不通过
          </a>
        </Space>
      ),
    },
  ];

  //待审批跳转详情
  const toDetail1 = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail1`, { state: record });
  };

  // 渲染待审批表格数据
  const getData2 = () => {
    http({
      url: "/getTeacher2",
    }).then((res) => {
      console.log("所有数据", res);

      let _data = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData2(_data);
    });
  };
  useEffect(() => {
    getData2();
  }, []);

  //待审批搜索的表单
  const [searchText2] = Form.useForm();
  //待审批搜索
  const onSearch2 = (search: any) => {
    http({
      url: "/searchTeacherTwo",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData2(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //待审批清空搜索
  const clear2 = () => {
    searchText2.resetFields();
    getData2();
  };
  //待审批通过
  const [isModalOpenPass1, setIsModalOpenPass1] = useState(false);
  const [passForm1] = Form.useForm();
  const showPass1 = (record: any) => {
    passForm1.setFieldsValue({ ...record });
    setIsModalOpenPass1(true);
  };
  const handleOkPass1 = () => {
    const data1 = passForm1.getFieldsValue(true);
    http({
      url: "/passTeacher1",
      method: "post",
      data: {
        id: data1.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("已通过");
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
        setIsModalOpenPass1(false);
      } else {
        message.error("通过失败");
      }
    });
  };
  const handleCancelPass1 = () => {
    setIsModalOpenPass1(false);
  };
  //待审批不通过
  const [isModalOpenNoPass1, setIsModalOpenNoPass1] = useState(false);
  const [noPassForm1] = Form.useForm();
  const showNoPass1 = (record: any) => {
    noPassForm1.setFieldsValue({ ...record });
    setIsModalOpenNoPass1(true);
  };
  const handleOkNoPass1 = () => {
    const data1 = noPassForm1.getFieldsValue(true);
    http({
      url: "/noPassTeacher1",
      method: "post",
      data: {
        id: data1.id,
        noreason: data1.noreason,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("未通过成功");
        setIsModalOpenNoPass1(false);
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
      } else {
        message.error("未通过失败");
      }
    });
  };
  const handleCancelNoPass1 = () => {
    setIsModalOpenNoPass1(false);
  };

  //待教育局审核表格
  const [data3, setData3] = useState([]);
  interface DataType3 {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    ttime: string;
  }
  const columns3: ColumnsType<DataType3> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail2(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "提交时间",
      dataIndex: "ttime",
      key: "ttime",
      render: (text) => <a className="todate">{toTime(text)}</a>,
    },
    {
      title: "操作",
      key: "action",
      render: (_: any, record: any) => (
        <Space size="middle">
          <a
            onClick={() => {
              showPass2(record);
            }}
            className="tname"
          >
            通过
          </a>
          <a
            onClick={() => {
              showNoPass2(record);
            }}
            className="noPass"
          >
            不通过
          </a>
        </Space>
      ),
    },
  ];
  // 渲染待教育局审核表格数据
  const getData3 = () => {
    http({
      url: "/getTeacher3",
    }).then((res) => {
      console.log("所有数据", res);

      let _data = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData3(_data);
    });
  };
  useEffect(() => {
    getData3();
  }, []);
  //待教育局审核跳转详情
  const toDetail2 = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail2`, { state: record });
  };
  //待教育局审核搜索的表单
  const [searchText3] = Form.useForm();
  //待教育局审核搜索
  const onSearch3 = (search: any) => {
    console.log("search", JSON.stringify(search));
    http({
      url: "/searchTeacherThree",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
        ttime:
          toDate(search.ttime) == "NaN-NaN-NaN"
            ? ""
            : toDate(search.ttime) || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData3(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //待教育局审核清空搜索
  const clear3 = () => {
    searchText3.resetFields();
    getData3();
  };
  //待教育局审核通过
  const [isModalOpenPass2, setIsModalOpenPass2] = useState(false);
  const [passForm2] = Form.useForm();
  const showPass2 = (record: any) => {
    passForm2.setFieldsValue({ ...record });
    setIsModalOpenPass2(true);
  };
  const handleOkPass2 = () => {
    const data2 = passForm2.getFieldsValue(true);
    http({
      url: "/passTeacher2",
      method: "post",
      data: {
        id: data2.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("通过成功");
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
        setIsModalOpenPass2(false);
      } else {
        message.error("通过失败");
      }
    });
  };
  const handleCancelPass2 = () => {
    setIsModalOpenPass2(false);
  };
  //待教育局审核不通过
  const [isModalOpenNoPass2, setIsModalOpenNoPass2] = useState(false);
  const [noPassForm2] = Form.useForm();
  const showNoPass2 = (record: any) => {
    noPassForm2.setFieldsValue({ ...record });
    setIsModalOpenNoPass2(true);
  };
  const handleOkNoPass2 = () => {
    const data2 = noPassForm2.getFieldsValue(true);
    http({
      url: "/noPassTeacher2",
      method: "post",
      data: {
        id: data2.id,
        noreason: data2.noreason,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("未通过成功");
        setIsModalOpenNoPass2(false);
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
      } else {
        message.error("未通过失败");
      }
    });
  };
  const handleCancelNoPass2 = () => {
    setIsModalOpenNoPass2(false);
  };

  //未通过表格
  const [data4, setData4] = useState([]);
  interface DataType4 {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    noreason: string;
    ttime: string;
    noime: string;
  }
  const columns4: ColumnsType<DataType4> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail3(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "原因",
      dataIndex: "noreason",
      key: "noreason",
    },
    {
      title: "不通过时间",
      dataIndex: "notime",
      key: "notime",
      render: (text) => <a className="todate">{toTime(text)}</a>,
    },
  ];

  // 渲染未通过表格数据
  const getData4 = () => {
    http({
      url: "/getTeacher4",
    }).then((res) => {
      console.log("所有数据", res);

      let _data = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData4(_data);
    });
  };
  useEffect(() => {
    getData4();
  }, []);
  //未通过跳转详情
  const toDetail3 = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail3`, { state: record });
  };
  //未通过搜索的表单
  const [searchText4] = Form.useForm();
  //未通过搜索
  const onSearch4 = (search: any) => {
    console.log("search", JSON.stringify(search));
    http({
      url: "/searchTeacherFour",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
        notime:
          toDate(search.notime) == "NaN-NaN-NaN"
            ? ""
            : toDate(search.notime) || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData4(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //未通过清空搜索
  const clear4 = () => {
    searchText4.resetFields();
    getData4();
  };

  //已通过表格
  const [data5, setData5] = useState([]);
  interface DataType5 {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    isgo: string;
    passtime: string;
  }
  const columns5: ColumnsType<DataType5> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail4(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "是否离职",
      dataIndex: "isgo",
      key: "isgo",
    },
    {
      title: "通过时间",
      dataIndex: "passtime",
      key: "passtime",
      render: (text) => <a className="todate">{toTime(text)}</a>,
    },
  ];

  // 渲染已通过表格数据
  const getData5 = () => {
    http({
      url: "/getTeacher5",
    }).then((res) => {
      console.log("所有数据", res);

      let _data = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData5(_data);
    });
  };
  useEffect(() => {
    getData5();
  }, []);
  //已通过跳转详情
  const toDetail4 = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail4`, { state: record });
  };
  //已通过搜索的表单
  const [searchText5] = Form.useForm();
  //已通过搜索
  const onSearch5 = (search: any) => {
    http({
      url: "/searchTeacherFive",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
        passtime:
          toDate(search.passtime) == "NaN-NaN-NaN"
            ? ""
            : toDate(search.passtime) || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData5(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //已通过清空搜索
  const clear5 = () => {
    searchText5.resetFields();
    getData5();
  };

  //黑名单表格
  const [data6, setData6] = useState([]);
  interface DataType6 {
    key: string;
    tname: string;
    tinstitution: string;
    tsex: string;
    tborn: string;
    tidentity: string;
    tdegree: string;
    tface: string;
    tcourse: string;
    black: string;
  }
  const columns6: ColumnsType<DataType6> = [
    {
      title: "老师姓名",
      dataIndex: "tname",
      key: "tname",
      render: (text, record) => (
        <a
          onClick={() => {
            toDetail5(record);
          }}
          className="tname"
        >
          {text}
        </a>
      ),
    },
    {
      title: "所属机构",
      dataIndex: "tinstitution",
      key: "tinstitution",
    },
    {
      title: "性别",
      dataIndex: "tsex",
      key: "tsex",
    },
    {
      title: "出生年月",
      dataIndex: "tborn",
      key: "tborn",
      render: (text) => <a className="todate">{toDate(text)}</a>,
    },
    {
      title: "身份证号码",
      dataIndex: "tidentity",
      key: "tidentity",
    },
    {
      title: "学历",
      dataIndex: "tdegree",
      key: "tdegree",
    },
    {
      title: "政治面貌",
      dataIndex: "tface",
      key: "tface",
    },
    {
      title: "学科",
      dataIndex: "tcourse",
      key: "tcourse",
    },
    {
      title: "原因",
      dataIndex: "black",
      key: "black",
    },
    {
      title: "操作",
      key: "action",
      render: (_: any, record: any) => (
        <Space size="middle">
          <a
            onClick={() => {
              showBack(record);
            }}
            className="tname"
          >
            撤销黑名单
          </a>
          <Popconfirm
            title="你确定删除这条信息吗?"
            onConfirm={() => {
              confirm6(record);
            }}
            onCancel={cancel6}
            okText="确定"
            cancelText="取消"
          >
            <a href="#" className="del">
              删除
            </a>
          </Popconfirm>
        </Space>
      ),
    },
  ];

  // 渲染黑名单表格数据
  const getData6 = () => {
    http({
      url: "/getTeacher6",
    }).then((res) => {
      console.log("所有数据", res);

      let _data = res.data.map((v: { id: number }) => {
        return { ...v, key: v.id };
      });
      setData6(_data);
    });
  };
  useEffect(() => {
    getData6();
  }, []);
  //黑名单跳转详情
  const toDetail5 = (record: any) => {
    console.log("record", record);
    navigate(`/home/TeacherDetail5`, { state: record });
  };
  //黑名单搜索的表单
  const [searchText6] = Form.useForm();
  //黑名单搜索
  const onSearch6 = (search: any) => {
    http({
      url: "/searchTeacherSix",
      params: {
        tname: search.tname || "",
        tinstitution: search.tinstitution || "",
        tsex: search.tsex || "",
        tdegree: search.tdegree || "",
        tface: search.tface || "",
        tcourse: search.tcourse || "",
        tidentity: search.tidentity || "",
        black: search.black || "",
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("查询成功");
        let _data = res.data.map((v: { id: number }) => {
          return { ...v, key: v.id };
        });
        setData6(_data);
      } else {
        message.error("查询失败");
      }
    });
  };
  //黑名单清空搜索
  const clear6 = () => {
    searchText6.resetFields();
    getData6();
  };
  //撤销黑名单
  const [isModalOpenPass6, setIsModalOpenPass6] = useState(false);
  const [passForm6] = Form.useForm();
  const showBack = (record: any) => {
    passForm6.setFieldsValue({ ...record });
    setIsModalOpenPass6(true);
  };
  const handleOkPass6 = () => {
    const data6 = passForm6.getFieldsValue(true);
    http({
      url: "/backTeacher",
      method: "post",
      data: {
        id: data6.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("撤销成功");
        getData1();
        getData2();
        getData3();
        getData4();
        getData5();
        getData6();
        setIsModalOpenPass6(false);
      } else {
        message.error("撤销失败");
      }
    });
  };
  const handleCancelPass6 = () => {
    setIsModalOpenPass6(false);
  };
  // 确定删除
  const confirm6 = (record: { id: number }) => {
    http({
      url: "/delTeacher",
      method: "post",
      data: {
        id: record.id,
      },
    }).then((res: { [key: string]: any }) => {
      if (res.error == 0) {
        message.success("删除成功");
        getData6();
      } else {
        message.error("删除失败");
      }
    });
  };
  const cancel6 = () => {
    message.error("取消删除");
  };

  return (
    <div className="TeacherManage">
      <div className="title">老师管理</div>

      <div className="hr"></div>

      <Tabs
        defaultActiveKey="1"
        onChange={onChange}
        items={[
          {
            label: `待审核`,
            key: "1",
            children: (
              <>
                <Form
                  form={searchText1}
                  name="customized_form_controls"
                  onFinish={onSearch1}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item label="提交时间" name="ttime" className="time">
                    <DatePicker locale={locale} placeholder="" />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear1}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data1}
                        filename="老师管理-待审核导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={showAdd}>
                      新增
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns}
                  dataSource={data1}
                />

                {/* 新增框 */}
                <Modal
                  title="新增"
                  open={isAddOpen}
                  onCancel={handleCancelAdd}
                  footer={null}
                >
                  <Form
                    form={addText}
                    name="basic"
                    initialValues={{ remember: true }}
                    labelCol={{ span: 10 }}
                    wrapperCol={{ span: 16 }}
                    autoComplete="off"
                    onFinish={onAdd}
                  >
                    <div className="items">
                      <Form.Item
                        label="老师姓名"
                        name="tname"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            pattern: /^[\u2E80-\u9FFF]+$/,
                            message: "请输入老师姓名!",
                          },
                        ]}
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="所属机构"
                        style={{ width: 300 }}
                        name="tinstitution"
                        rules={[{ required: true, message: "请选择所属机构!" }]}
                      >
                        <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                      </Form.Item>

                      <Form.Item
                        label="出生年月"
                        name="tborn"
                        style={{ width: 300 }}
                        rules={[{ required: true, message: "请选择出生年月!" }]}
                      >
                        <DatePicker locale={locale} placeholder="" />
                      </Form.Item>

                      <Form.Item
                        label="性别"
                        style={{ width: 300 }}
                        rules={[{ required: true, message: "请选择老师性别!" }]}
                        name="tsex"
                      >
                        <Select>
                          <Select.Option value="男">男</Select.Option>
                          <Select.Option value="女">女</Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="身份证号"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            pattern:
                              /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/,
                            message: "请输入正确身份证号!",
                          },
                        ]}
                        name="tidentity"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="培训学科"
                        style={{ width: 300 }}
                        rules={[{ required: true, message: "请选择培训学科!" }]}
                        name="tcourse"
                      >
                        <Select>
                          <Select.Option value="数学">数学</Select.Option>
                          <Select.Option value="语文">语文</Select.Option>
                          <Select.Option value="英语">英语</Select.Option>
                          <Select.Option value="物理">物理</Select.Option>
                          <Select.Option value="化学">化学</Select.Option>
                          <Select.Option value="地理">地理</Select.Option>
                          <Select.Option value="生物">生物</Select.Option>
                          <Select.Option value="政治">政治</Select.Option>
                          <Select.Option value="历史">历史</Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="学历"
                        style={{ width: 300 }}
                        name="tdegree"
                        rules={[{ required: true, message: "请选择学历!" }]}
                      >
                        <Select>
                          <Select.Option value="本科">本科</Select.Option>
                          <Select.Option value="硕士">硕士</Select.Option>
                          <Select.Option value="博士">博士</Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="政治面貌"
                        style={{ width: 300 }}
                        rules={[
                          { required: true, message: "请选择你的政治面貌!" },
                        ]}
                        name="tface"
                      >
                        <Select>
                          <Select.Option value="群众">群众</Select.Option>
                          <Select.Option value="中共党员">
                            中共党员
                          </Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="资格证种类"
                        style={{ width: 300 }}
                        rules={[
                          { required: true, message: "请选择资格证种类!" },
                        ]}
                        name="tqualtype"
                      >
                        <Select>
                          <Select.Option value="幼儿园">幼儿园</Select.Option>
                          <Select.Option value="小学">小学</Select.Option>
                          <Select.Option value="初级中学">
                            初级中学
                          </Select.Option>
                          <Select.Option value="高级中学">
                            高级中学
                          </Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="资格证编码"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入资格证编码!",
                          },
                        ]}
                        name="tqualification"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="籍贯"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入籍贯!",
                          },
                        ]}
                        name="origin"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="毕业院校/专业"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入毕业院校/专业!",
                          },
                        ]}
                        name="graduate"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="是否签约合同"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请选择是否签约!",
                          },
                        ]}
                        name="contract"
                      >
                        <Select>
                          <Select.Option value="是">是</Select.Option>
                          <Select.Option value="否">否</Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="是否离职"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请选择是否离职!",
                          },
                        ]}
                        name="isgo"
                      >
                        <Select>
                          <Select.Option value="是">是</Select.Option>
                          <Select.Option value="否">否</Select.Option>
                        </Select>
                      </Form.Item>

                      <Form.Item
                        label="证件照"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入证件照照片地址!",
                            type: "url",
                          },
                        ]}
                        name="zjphoto"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="身份证照片地址"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入身份证照片地址!",
                            type: "url",
                          },
                        ]}
                        name="idphoto"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="学历证照片地址"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入学历证照片地址!",
                            type: "url",
                          },
                        ]}
                        name="xlphoto"
                      >
                        <Input />
                      </Form.Item>

                      <Form.Item
                        label="教师证照片地址"
                        style={{ width: 300 }}
                        rules={[
                          {
                            required: true,
                            message: "请输入教师资格证照片地址!",
                            type: "url",
                          },
                        ]}
                        name="jsphoto"
                      >
                        <Input />
                      </Form.Item>
                    </div>

                    <Form.Item wrapperCol={{ offset: 16, span: 16 }}>
                      <Button
                        className="clear"
                        htmlType="button"
                        onClick={handleCancelAdd}
                      >
                        取消
                      </Button>
                      <Button type="primary" htmlType="submit">
                        确定
                      </Button>
                    </Form.Item>
                  </Form>
                </Modal>

                {/* 编辑框 */}
                <Modal
                  title="编辑"
                  open={isModalOpen}
                  onOk={handleOk}
                  onCancel={handleCancel}
                  okText={"确认"}
                  cancelText={"取消"}
                >
                  <Form
                    form={editForm}
                    name="basic"
                    initialValues={{ remember: true }}
                    labelCol={{ span: 6 }}
                    wrapperCol={{ span: 16 }}
                    autoComplete="off"
                  >
                    <Form.Item
                      label="老师姓名"
                      name="tname"
                      rules={[
                        {
                          required: true,
                          pattern: /^[\u2E80-\u9FFF]+$/,
                          message: "请输入老师姓名!",
                        },
                      ]}
                    >
                      <Input />
                    </Form.Item>

                    <Form.Item
                      label="所属机构"
                      rules={[{ required: true, message: "请选择所属机构!" }]}
                      name="tinstitution"
                    >
                      <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                    </Form.Item>

                    <Form.Item
                      label="性别"
                      name="tsex"
                      rules={[{ required: true, message: "请选择老师性别!" }]}
                    >
                      <Select>
                        <Select.Option value="男">男</Select.Option>
                        <Select.Option value="女">女</Select.Option>
                      </Select>
                    </Form.Item>

                    <Form.Item
                      label="身份证号码"
                      rules={[
                        {
                          required: true,
                          pattern:
                            /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/,
                          message: "请输入正确身份证号!",
                        },
                      ]}
                      name="tidentity"
                    >
                      <Input />
                    </Form.Item>

                    <Form.Item label="学历" name="tdegree">
                      <Select>
                        <Select.Option value="本科">本科</Select.Option>
                        <Select.Option value="硕士">硕士</Select.Option>
                        <Select.Option value="博士">博士</Select.Option>
                      </Select>
                    </Form.Item>

                    <Form.Item label="政治面貌" name="tface">
                      <Select>
                        <Select.Option value="群众">群众</Select.Option>
                        <Select.Option value="中共党员">中共党员</Select.Option>
                      </Select>
                    </Form.Item>

                    <Form.Item
                      label="培训学科"
                      rules={[{ required: true, message: "请选择培训学科!" }]}
                      name="tcourse"
                    >
                      <Select>
                        <Select.Option value="数学">数学</Select.Option>
                        <Select.Option value="语文">语文</Select.Option>
                        <Select.Option value="英语">英语</Select.Option>
                        <Select.Option value="物理">物理</Select.Option>
                        <Select.Option value="化学">化学</Select.Option>
                        <Select.Option value="地理">地理</Select.Option>
                        <Select.Option value="生物">生物</Select.Option>
                        <Select.Option value="政治">政治</Select.Option>
                        <Select.Option value="历史">历史</Select.Option>
                      </Select>
                    </Form.Item>
                  </Form>
                </Modal>

                {/*不通过框*/}
                <Modal
                  title="不通过"
                  open={isModalOpenNoPass}
                  onOk={handleOkNoPass}
                  onCancel={handleCancelNoPass}
                  okText={"确认"}
                  cancelText={"取消"}
                >
                  <Form
                    form={noPassForm}
                    labelCol={{
                      span: 8,
                    }}
                    wrapperCol={{
                      span: 24,
                    }}
                    autoComplete="off"
                  >
                    <Form.Item name="noreason">
                      <TextArea rows={4} placeholder="请输入不同意理由" />
                    </Form.Item>
                  </Form>
                </Modal>

                {/*通过框*/}
                <Modal
                  title="通过"
                  open={isModalOpenPass}
                  onOk={handleOkPass}
                  onCancel={handleCancelPass}
                  okText={"确认"}
                  cancelText={"取消"}
                  className="pass-box"
                >
                  <Form form={passForm}>
                    <div>是否同意该老师通过审核？</div>
                  </Form>
                </Modal>
              </>
            ),
          },
          {
            label: `待审批`,
            key: "2",
            children: (
              <>
                <Form
                  name="basic"
                  form={searchText2}
                  initialValues={{ remember: true }}
                  onFinish={onSearch2}
                  // onFinishFailed={onFinishFailed}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear2}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data2}
                        filename="老师管理-待审批导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns2}
                  dataSource={data2}
                />

                {/*不通过框*/}
                <Modal
                  title="不通过"
                  open={isModalOpenNoPass1}
                  onOk={handleOkNoPass1}
                  onCancel={handleCancelNoPass1}
                  okText={"确认"}
                  cancelText={"取消"}
                >
                  <Form
                    form={noPassForm1}
                    labelCol={{
                      span: 8,
                    }}
                    wrapperCol={{
                      span: 24,
                    }}
                    autoComplete="off"
                  >
                    <Form.Item name="noreason">
                      <TextArea rows={4} placeholder="请输入不同意理由" />
                    </Form.Item>
                  </Form>
                </Modal>

                {/*通过框*/}
                <Modal
                  title="通过"
                  open={isModalOpenPass1}
                  onOk={handleOkPass1}
                  onCancel={handleCancelPass1}
                  okText={"确认"}
                  cancelText={"取消"}
                  className="pass-box"
                >
                  <Form form={passForm1}>
                    <div>是否同意该老师通过审核？</div>
                  </Form>
                </Modal>
              </>
            ),
          },
          {
            label: "待教育局审核",
            key: "3",
            children: (
              <>
                <Form
                  name="basic"
                  form={searchText3}
                  initialValues={{ remember: true }}
                  onFinish={onSearch3}
                  // onFinishFailed={onFinishFailed}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item label="提交时间" name="ttime" className="time">
                    <DatePicker locale={locale} placeholder="" />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear3}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data3}
                        filename="老师管理-待教育局审核导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns3}
                  dataSource={data3}
                />

                {/*不通过框*/}
                <Modal
                  title="不通过"
                  open={isModalOpenNoPass2}
                  onOk={handleOkNoPass2}
                  onCancel={handleCancelNoPass2}
                  okText={"确认"}
                  cancelText={"取消"}
                >
                  <Form
                    form={noPassForm2}
                    labelCol={{
                      span: 8,
                    }}
                    wrapperCol={{
                      span: 24,
                    }}
                    autoComplete="off"
                  >
                    <Form.Item name="noreason">
                      <TextArea rows={4} placeholder="请输入不同意理由" />
                    </Form.Item>
                  </Form>
                </Modal>

                {/*通过框*/}
                <Modal
                  title="通过"
                  open={isModalOpenPass2}
                  onOk={handleOkPass2}
                  onCancel={handleCancelPass2}
                  okText={"确认"}
                  cancelText={"取消"}
                  className="pass-box"
                >
                  <Form form={passForm2}>
                    <div>是否同意该老师通过审核？</div>
                  </Form>
                </Modal>
              </>
            ),
          },
          {
            label: "未通过",
            key: "4",
            children: (
              <>
                <Form
                  name="basic"
                  form={searchText4}
                  initialValues={{ remember: true }}
                  onFinish={onSearch4}
                  // onFinishFailed={onFinishFailed}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item label="不通过时间" name="notime" className="time">
                    <DatePicker locale={locale} placeholder="" />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear4}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data4}
                        filename="老师管理-未通过导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns4}
                  dataSource={data4}
                />
              </>
            ),
          },
          {
            label: "已通过",
            key: "5",
            children: (
              <>
                <Form
                  name="basic"
                  form={searchText5}
                  initialValues={{ remember: true }}
                  onFinish={onSearch5}
                  // onFinishFailed={onFinishFailed}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item label="通过时间" name="passtime" className="time">
                    <DatePicker locale={locale} placeholder="" />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear5}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data5}
                        filename="老师管理-已通过导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns5}
                  dataSource={data5}
                />
              </>
            ),
          },
          {
            label: "黑名单",
            key: "6",
            children: (
              <>
                <Form
                  name="basic"
                  form={searchText6}
                  initialValues={{ remember: true }}
                  onFinish={onSearch6}
                  // onFinishFailed={onFinishFailed}
                  autoComplete="off"
                  className="form"
                >
                  <Form.Item
                    label="老师姓名"
                    name="tname"
                    style={{ width: 200 }}
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item
                    label="所属机构"
                    name="tinstitution"
                    className="institution"
                  >
                    <Select allowClear={true}>
                      {ins.map((i: any) => (
                        <Select.Option value={i.oname}>{i.oname}</Select.Option>
                      ))}
                    </Select>
                  </Form.Item>

                  <Form.Item label="性别" className="sex" name="tsex">
                    <Select>
                      <Select.Option value="男">男</Select.Option>
                      <Select.Option value="女">女</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学历" className="degree" name="tdegree">
                    <Select>
                      <Select.Option value="本科">本科</Select.Option>
                      <Select.Option value="硕士">硕士</Select.Option>
                      <Select.Option value="博士">博士</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="政治面貌" className="face" name="tface">
                    <Select>
                      <Select.Option value="群众">群众</Select.Option>
                      <Select.Option value="中共党员">中共党员</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item label="学科" name="tcourse" className="subject">
                    <Select>
                      <Select.Option value="数学">数学</Select.Option>
                      <Select.Option value="语文">语文</Select.Option>
                      <Select.Option value="英语">英语</Select.Option>
                      <Select.Option value="物理">物理</Select.Option>
                      <Select.Option value="化学">化学</Select.Option>
                      <Select.Option value="地理">地理</Select.Option>
                      <Select.Option value="生物">生物</Select.Option>
                      <Select.Option value="政治">政治</Select.Option>
                      <Select.Option value="历史">历史</Select.Option>
                    </Select>
                  </Form.Item>

                  <Form.Item
                    label="身份证号码"
                    name="tidentity"
                    className="identity"
                  >
                    <Input />
                  </Form.Item>

                  <Form.Item label="黑名单原因" name="black" className="black">
                    <Input />
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn1" htmlType="submit">
                      查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn" onClick={clear6}>
                      清空查询
                    </Button>
                  </Form.Item>

                  <Form.Item>
                    <Button className="btn">
                      <CSVLink
                        className="tname"
                        data={data6}
                        filename="老师管理-黑名单导出表.csv"
                      >
                        导出结果
                      </CSVLink>
                    </Button>
                  </Form.Item>
                </Form>

                <Table
                  className="table"
                  pagination={{ defaultPageSize: 5 }}
                  columns={columns6}
                  dataSource={data6}
                />

                {/* 撤销黑名单弹框 */}
                <Modal
                  title="是否撤销黑名单"
                  open={isModalOpenPass6}
                  onOk={handleOkPass6}
                  onCancel={handleCancelPass6}
                  okText={"确认"}
                  cancelText={"取消"}
                  className="pass-box"
                >
                  <Form form={passForm6}>
                    <div>是否同意该老师撤销黑名单到待审核？</div>
                  </Form>
                </Modal>
              </>
            ),
          },
        ]}
      />
    </div>
  );
};

export default TeacherManage;
